package com.ymm.system.dao.mapper;

import com.ymm.system.api.constants.TradeEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author Mark sunlightcs@gmail.com
 * @since 1.0.0 2022-08-03
 */
@Mapper
public interface TradeMapper {

    List<TradeEntity> getTrades();

    void insertNewTrade(@Param("tradeEntity") TradeEntity tradeEntity);

    //判断运单是否为空作为触发条件
    Integer getTradeId(Long tradeId);

    //查看当前运单状态
    Integer getTradeState(Long tradeId);

    //前往装货
    Integer goCargoLocation(Long tradeId);

    //到达装货地
    Integer arriveOnCargoLocation(Long tradeId);

    //到达卸货地
    Integer arriveOffCargoLocation(Long tradeId);

    //已卸货
    Integer finishedOffCargo(Long tradeId);

    //已完成
    Integer finishedTrade(Long tradeId);

    //更新到达时间
    void updateTradeArriveTime(Long tradeId);

    //更新开始运输时间
    void updateTradeLoadTime(Long tradeId);

    //更新卸货时间
    void updateTradeDischargeTime(Long tradeId);

}